Calculate profit and loss